package com.inspur.gs.sbssdl.dzyhpgl.dzyhpbasedata.dzyhpbasedata.front.sbssdzyhpwlxxform_frm.voactions;
import com.inspur.edp.bff.api.manager.context.QueryContext;
import com.inspur.edp.bff.spi.action.query.AbstractQueryAction;
import com.inspur.edp.cef.entity.condition.*;

import java.util.ArrayList;

public class QuerySetVOAction extends AbstractQueryAction {

	public QuerySetVOAction(QueryContext context){
		super(context);
	}
	@Override
	public void execute() {
		EntityFilter filter = this.getQueryContext().getFilter();
		ArrayList<FilterCondition> filterListOrg = filter.getFilterConditions();

		String lbbh = getContext().getVariableData().getValue("lbbhMap").toString();

		if (lbbh != null && !lbbh.isEmpty()) {
			ArrayList<FilterCondition> newFilterList = new ArrayList<>();
			newFilterList.add(new FilterCondition(1, "lb_id_lbbh",ExpressCompareType.LikeStartWith, lbbh, 1,ExpressRelationType.And, ExpressValueType.Value));
			newFilterList.addAll(filterListOrg);
			filter.setFilterConditions(newFilterList);
		}
	}
}
